package com.framelib.utils;

public class Page {

	public Page(){}
	public Page(Integer pageCount,Integer prePage){
		this.pageCount = pageCount;
		this.prePage = prePage;
		if(null!=pageCount&&null!=prePage){
			this.begin = (pageCount-1)*prePage<=0?0:(pageCount-1)*prePage;
			this.end = (pageCount)*prePage-1<=0?1:(pageCount)*prePage-1;
		}
	}
	
	private Integer pageCount = 1;//页码
	private Integer prePage = 10;//每页数据
	private Integer begin;//0开始
	private Integer end;
	
	
	public Integer getPageCount() {
		return pageCount;
	}
	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}
	public Integer getPrePage() {
		return prePage;
	}
	public void setPrePage(Integer prePage) {
		this.prePage = prePage;
	}
	public Integer getBegin() {
		if(null!=pageCount&&null!=prePage){
			this.begin = (pageCount-1)*prePage;
			return begin;
		}
		return begin;
	}
	public void setBegin(Integer begin) {
		this.begin = begin;
	}
	public Integer getEnd() {
		if(null!=pageCount&&null!=prePage){
			this.end = (pageCount)*prePage-1;
			return end;
		}
		return end;
	}
	public void setEnd(Integer end) {
		this.end = end;
	}
	
}
